package com.org.platform.utils;

import java.math.BigDecimal;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.Date;

/**
 * @author duheng
 * @Date 2021/8/30 15:53
 */
public class Test {

	public static void main(String[] args) {
		LocalDateTime startDateTime = LocalDateUtil.localDateTimeParse("2022-02-10 09:00:01", LocalDateUtil.FORMAT_PATTERN1);
		Date startDate = LocalDateUtil.localDateTimeToDate(startDateTime);

		LocalDateTime endDateTime = LocalDateUtil.localDateTimeParse("2022-02-12 08:00:01", LocalDateUtil.FORMAT_PATTERN1);
		Date endDate = LocalDateUtil.localDateTimeToDate(endDateTime);

		ZoneId zoneId = ZoneId.systemDefault();
		Instant instant = startDate.toInstant();
		LocalDate compareStartTime = instant.atZone(zoneId).toLocalDate();
		instant = endDate.toInstant();
		LocalDate compareEndTime = instant.atZone(zoneId).toLocalDate();
		long intervalDays = compareStartTime.until(compareEndTime, ChronoUnit.DAYS);
		System.out.println(intervalDays);


		BigDecimal a = new BigDecimal("2");
		BigDecimal b = new BigDecimal("3");
		BigDecimal c = b.divide(a, 0, BigDecimal.ROUND_UP);
		System.out.println(c);
		/*String a = "a";
		if (a == null || null != a && true) {
			System.out.println("true");
		}else{
			System.out.println("false");
		}*/
	}


}
